package jaux.message.codec.example.message;

import jaux.message.codec.annotation.ByteMessageField;
import jaux.message.codec.annotation.UplinkByteMessage;

@UplinkByteMessage(name = "2")
public class PumpStateMessage  {

	@ByteMessageField("toInt(range(7, 9),false)")
	private Integer analog1;
	
	@ByteMessageField("toInt(range(9, 11),false)")
	private Integer analog2;
	
	@ByteMessageField("toInt(range(11, 13),false)")
	private Integer analog3;
	
	@ByteMessageField("toInt(range(13, 15),false)")
	private Integer analog4;
	
	@ByteMessageField("toInt(range(15, 17),false)")
	private Integer analog5;
	
	@ByteMessageField("toInt(range(17, 19),false)")
	private Integer analog6;

	@ByteMessageField("toInt(range(19, 21),false)")
	private Integer ext1;
	
	@ByteMessageField("toInt(range(21, 23),false)")
	private Integer ext2;
	
	@ByteMessageField("printHex(range(23, 35))")
	private String timestamp;
	/**
	 * 噪声，单位dB
	 */
	@ByteMessageField("keepDecimals(scale(getVar('analog1')/1000d,4,20,30,130),2)")
	private Double noise;
	
	/**
	 * 振动，单位mm/s
	 */
	@ByteMessageField("keepDecimals(scale(getVar('analog2')/1000d,4,20,0,20),3)")
	private Double vibration;
	/**
	 * 电机振动，单位mm/s
	 */
	@ByteMessageField("keepDecimals(scale(getVar('analog3')/1000d,4,20,0,20),2)")
	private Double motorVibration;
	
//	/**
//	 * 温度，单位℃
//	 */
//	@ByteMessageField("scale(getVar('analog3')/1000d,4,20,0,100)")
//	private Double  temperature;
	
	/**
	 * 压力，单位kPa 
	 */
	@ByteMessageField("keepDecimals(scale(getVar('analog4')/1000d,4,20,0,30),2)")
	private Double pressure;
	
	/**
	 * 转速1,单位rpm
	 */
	@ByteMessageField("keepDecimals(getVar('ext1')*0.1,2)")
	private Double rotationalSpeed1;
	
	/**
	 * 转速2,单位rpm
	 */
	@ByteMessageField("keepDecimals(getVar('ext2')*0.1,2)")
	private Double rotationalSpeed2;

	public Double getNoise() {
		return noise;
	}

	public void setNoise(Double noise) {
		this.noise = noise;
	}

	public Double getVibration() {
		return vibration;
	}

	public void setVibration(Double vibration) {
		this.vibration = vibration;
	}

//	public Double getTemperature() {
//		return temperature;
//	}
//
//	public void setTemperature(Double temperature) {
//		this.temperature = temperature;
//	}

	public Double getPressure() {
		return pressure;
	}

	public void setPressure(Double pressure) {
		this.pressure = pressure;
	}

	public Double getRotationalSpeed1() {
		return rotationalSpeed1;
	}

	public void setRotationalSpeed1(Double rotationalSpeed1) {
		this.rotationalSpeed1 = rotationalSpeed1;
	}

	public Double getRotationalSpeed2() {
		return rotationalSpeed2;
	}

	public void setRotationalSpeed2(Double rotationalSpeed2) {
		this.rotationalSpeed2 = rotationalSpeed2;
	}

	public Double getMotorVibration() {
		return motorVibration;
	}

	public void setMotorVibration(Double motorVibration) {
		this.motorVibration = motorVibration;
	}

	
	public Integer getAnalog1() {
		return analog1;
	}

	
	public void setAnalog1(Integer analog1) {
		this.analog1 = analog1;
	}

	
	public Integer getAnalog2() {
		return analog2;
	}

	
	public void setAnalog2(Integer analog2) {
		this.analog2 = analog2;
	}

	
	public Integer getAnalog3() {
		return analog3;
	}

	
	public void setAnalog3(Integer analog3) {
		this.analog3 = analog3;
	}

	
	public Integer getAnalog4() {
		return analog4;
	}

	
	public void setAnalog4(Integer analog4) {
		this.analog4 = analog4;
	}

	
	public Integer getAnalog5() {
		return analog5;
	}

	
	public void setAnalog5(Integer analog5) {
		this.analog5 = analog5;
	}

	
	public Integer getAnalog6() {
		return analog6;
	}

	
	public void setAnalog6(Integer analog6) {
		this.analog6 = analog6;
	}

	
	public Integer getExt1() {
		return ext1;
	}

	
	public void setExt1(Integer ext1) {
		this.ext1 = ext1;
	}

	
	public Integer getExt2() {
		return ext2;
	}

	
	public void setExt2(Integer ext2) {
		this.ext2 = ext2;
	}

	
	public String getTimestamp() {
		return timestamp;
	}

	
	public void setTimestamp(String timestamp) {
		this.timestamp = timestamp;
	}
}
